import 'package:healthy_station_flutter/generated/json/base/json_convert_content.dart';
import 'package:healthy_station_flutter/entity/fee_info_entity.dart';

FeeInfoEntity $FeeInfoEntityFromJson(Map<String, dynamic> json) {
  final FeeInfoEntity feeInfoEntity = FeeInfoEntity();
  final String? billId = jsonConvert.convert<String>(json['billId']);
  if (billId != null) {
    feeInfoEntity.billId = billId;
  }
  final String? billType = jsonConvert.convert<String>(json['billType']);
  if (billType != null) {
    feeInfoEntity.billType = billType;
  }
  final String? feeName = jsonConvert.convert<String>(json['feeName']);
  if (feeName != null) {
    feeInfoEntity.feeName = feeName;
  }
  final String? price = jsonConvert.convert<String>(json['price']);
  if (price != null) {
    feeInfoEntity.price = price;
  }
  final String? num = jsonConvert.convert<String>(json['num']);
  if (num != null) {
    feeInfoEntity.num = num;
  }
  final String? unit = jsonConvert.convert<String>(json['unit']);
  if (unit != null) {
    feeInfoEntity.unit = unit;
  }
  final String? amount = jsonConvert.convert<String>(json['amount']);
  if (amount != null) {
    feeInfoEntity.amount = amount;
  }
  return feeInfoEntity;
}

Map<String, dynamic> $FeeInfoEntityToJson(FeeInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['billId'] = entity.billId;
  data['billType'] = entity.billType;
  data['feeName'] = entity.feeName;
  data['price'] = entity.price;
  data['num'] = entity.num;
  data['unit'] = entity.unit;
  data['amount'] = entity.amount;
  return data;
}

extension FeeInfoEntityExtension on FeeInfoEntity {
  FeeInfoEntity copyWith({
    String? billId,
    String? billType,
    String? feeName,
    String? price,
    String? num,
    String? unit,
    String? amount,
  }) {
    return FeeInfoEntity()
      ..billId = billId ?? this.billId
      ..billType = billType ?? this.billType
      ..feeName = feeName ?? this.feeName
      ..price = price ?? this.price
      ..num = num ?? this.num
      ..unit = unit ?? this.unit
      ..amount = amount ?? this.amount;
  }
}